<?php 
include('../Connections/KRAPPERCON.php');

$code= getVal('t_code');
$option = getVal('t_option');

$veh = new Any();
$veh->serie  = '';
$veh->placa = '';
$veh->vin = '';
$veh->motor ='';
$veh->afab = '';
$veh->amod = '';
$veh->marid = '';
$veh->pmot = '';
$veh->client = '';
$veh->obs = '';
$veh->freg = '';
$veh->user = '';
$veh->tcom = '';
$veh->marca = '';

$sql = "call sp_getVehiculoOptOT('".$code."','".$option."');";
	$res = $mysqli->query($sql);
	//doEcho($sql);
	if ($res){
		if ($row=$res->fetch_assoc()){
			$found = true;			
			$veh->serie  = $row['VehID'];
			$veh->placa = $row['VehPlaca'];
			$veh->vin = $row['VehVIN'];
			$veh->motor = $row['VehNroMot'];
			$veh->afab = $row['VehAnFab'];
			$veh->amod = $row['VehAnMod'];
			$veh->marid = $row['MarcaID'];
			$veh->pmot = $row['VehPoMot'];
			$veh->client = $row['ClientID'];
			$veh->obs = $row['VehObs'];
			$veh->freg = $row['VehFeReg'];
			$veh->user = $row['UserID'];
			$veh->tcom = $row['VehTiCom'];
			$veh->marca = $row['MarcaTxt'];
		}
	$res->close();
	$mysqli->check_result();
	}
	
	echo json_encode($veh);
?>